home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 22
/
Cream of the Crop 22.iso
/
bbs
/
maxkit25.zip
/
CKXP-DOB.ARJ
/
CKXP-DOB.MEX
next >
Wrap
Text File
|
1996-11-05
|
3KB
|
89 lines
//////////////////////////////////////////////////////////////////////////////
// Free for non-commercial use.
// Copyright 1995 by Gerry Ellison. All rights reserved.
// File: ckxp-dob.mex v1.01 by Gerry Ellison 1:108/107
// Desc: Routine to check user's expiry time,
// Desc: Routine to check user's date of birth and call Birthday File.
// Copyright 1995 by Gerry Ellison. All rights reserved.
// $Id: CKXP-DOB.MEX 1.0 1995/10/22 24:00:00 gre Exp $
//////////////////////////////////////////////////////////////////////////////
// #define DEBUG
#include <max.mh>
int substrtoi(ref string: s, int: start, int: len)
{
string: t;
t:=substr(s,start,len);
return strtoi(t);
}
//int main(string: argv)
int main()
{
char: nonstop;
int: dx, dm;
// nonstop:=0;
struct _stamp: cur; // Current date/time
int: cd; // Binary current day
int: cm; // Binary current month
int: cy; // Binary current year
int: bd; // Binary day of birth
int: bm; // Binary month of birth
int: xd; // Binary expire day
int: xm; // Binary expire month
int: xy; // Binary expire year
// Set dates.
timestamp(cur);
cd:=cur.date.day;
cm:=cur.date.month;
cy:=cur.date.year;
bd:=substrtoi(usr.dob,9,2);
bm:=substrtoi(usr.dob,6,2);
xd:=usr.xp_date.date.day;
xm:=usr.xp_date.date.month;
xy:=usr.xp_date.date.year;
{
}
// Check for days in month.
if (cm=2) dm:=27;
else if (cm=2 and cy=16) dm:=28;
else if (cm=4 or cm=6 or cm=9 or cm=11) dm:=30;
else dm:=31;
{
// Check if user has expiry set.
if (usr.expdate=FALSE)
print("\x16\x01\x0e *** For Additional Time see Main Menu. ***\n");
if (usr.expdate=TRUE)
// Check if expiry is in this month.
if (cy=xy and cm=xm and xd-cd >0=1)
print("\x16\x01\x0c *** Time flies, your account expires in ",xd-cd," Days ***\n");
// Check if expiry is in next month.
else if (cy=xy and cm+1=xm and (dm-cd)+(xd)<30=1)
print("\x16\x01\x0c *** Time flies, your account expires in ",(dm-cd)+(xd)," Days ***\n");
// Check if expiry is in next year.
else if (cy+1=xy and cm-11=xm and (dm-cd)+xd<30=1)
print("\x16\x01\x0c *** Time flies, your account expires in ",(dm-cd)+xd," Days ***\n");
// Print thank you screen.
else
print("\x16\x01\x0a *** Thanks for your support of The Mountain Top. ***\n");
}
{
// substr(usr.dob,3,2) = "00";
}
{
// Check for user birth day and display Birthday.bbs if true.
if (cm=bm and cd=bd)
display_file("C:\\Max\\MaxKit\\Birthday.bbs", nonstop);
else
return 0;
}
}